# Maintainer: Jan Alexander Steffens (heftig) <heftig@archlinux.org>
# Contributor: Allan McRae <allan@archlinux.org>
# Contributor: Jan de Groot <jgc@archlinux.org>
# Contributor: William Rea <sillywilly@gmail.com>

pkgname=brasero
pkgver=3.12.3+r24+gd01ba738
pkgrel=1
pkgdesc="CD/DVD mastering tool"
url="https://wiki.gnome.org/Apps/Brasero"
arch=(x86_64)
license=(GPL)
depends=(gtk3 gst-plugins-good totem-plparser cdrtools cdrdao shared-mime-info
         libcanberra dvd+rw-tools dconf libsm libnotify gvfs tracker3)
makedepends=(gtk-doc yelp-tools gnome-common intltool libburn libisofs
             gobject-introspection itstool docbook-xsl git)
optdepends=('libburn: alternative back-end'
            'libisofs: libburn back-end'
            'dvdauthor: video project'
            'vcdimager: video project')
options=(debug)
_commit=d01ba738eb22502852fdc6001d2422bc7af04116  # master
source=("git+https://gitlab.gnome.org/GNOME/brasero.git#commit=$_commit")
sha256sums=('SKIP')

pkgver() {
  cd brasero
  git describe --tags | sed 's/[^-]*-g/r&/;s/-/+/g'
}

prepare() {
  cd brasero
  NOCONFIGURE=1 ./autogen.sh
}

build() {
  cd brasero
  ./configure \
    --prefix=/usr \
    --sysconfdir=/etc \
    --localstatedir=/var \
    --disable-caches \
    --disable-search \
    --disable-schemas-compile \
    --enable-compile-warnings=minimum \
    --enable-gtk-doc
  sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool
  make
}

package() {
  cd brasero
  make DESTDIR="$pkgdir" install
}
